<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>Document</title>
  <style>
	 div#div_box{
	    height:100px;
		border:solid 1px yellow;
		margin-top:10px;
	 }
	 div div{
	    width:100px;
		height:100px;
		border:solid 1px black;
		float:left;
		margin-left:10px;
	 }
  </style>
  <script src="jQuery复习/jquery-3.3.1.js"></script>
 </head>
 <body>
    <button>div[class]</button>
	<button>div[class=div3]</button>
	<button>div[class!=div3]</button>
	<button>div[class^=d]</button>
	<button>div[class$=3]</button>
	<button>div[class][id]</button>
    <div id="div_box">
	   <div class="div1">div1</div>
	   <div class="div2">div2</div>
	   <div class="div3">div3</div>
	   <div class="div3">div3</div>
	   <div class="div3" id="id1">div3,id1</div>
    </div>
 </body>
 <script>
    $("button:eq(0)").click(function(){
	   //查找含有class属性的所有元素
	   $("div[class]").css({"backgroundColor":"red"});
	});
	$("button:eq(1)").click(function(){
	   //查找含有class属性为div3的所有元素
	   $("div[class=div3]").css({"backgroundColor":"blue"});
	});
	$("button:eq(2)").click(function(){
	   //查找含有class属性不为div3的所有元素
	   $("div[class!=div3]").css({"backgroundColor":"white"});
	});
 </script>
</html>
